<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>digichef.voting.templatetags.voting_tags</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="digichef-module.html">Package&nbsp;digichef</a> ::
        <a href="digichef.voting-module.html">Package&nbsp;voting</a> ::
        <a href="digichef.voting.templatetags-module.html">Package&nbsp;templatetags</a> ::
        Module&nbsp;voting_tags
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="digichef.voting.templatetags.voting_tags-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module voting_tags</h1><p class="nomargin-top"><span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html">source&nbsp;code</a></span></p>
<!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Classes</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Classes"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="digichef.voting.templatetags.voting_tags.ScoreForObjectNode-class.html" class="summary-name">ScoreForObjectNode</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="digichef.voting.templatetags.voting_tags.ScoresForObjectsNode-class.html" class="summary-name">ScoresForObjectsNode</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="digichef.voting.templatetags.voting_tags.VoteByUserNode-class.html" class="summary-name">VoteByUserNode</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="digichef.voting.templatetags.voting_tags.VotesByUserNode-class.html" class="summary-name">VotesByUserNode</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="digichef.voting.templatetags.voting_tags.DictEntryForItemNode-class.html" class="summary-name">DictEntryForItemNode</a>
    </td>
  </tr>
</table>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="digichef.voting.templatetags.voting_tags-module.html#do_score_for_object" class="summary-sig-name">do_score_for_object</a>(<span class="summary-sig-arg">parser</span>,
        <span class="summary-sig-arg">token</span>)</span><br />
      Retrieves the total score for an object and the number of votes
it's received and stores them in a context variable which has
``score`` and ``num_votes`` properties.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#do_score_for_object">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="digichef.voting.templatetags.voting_tags-module.html#do_scores_for_objects" class="summary-sig-name">do_scores_for_objects</a>(<span class="summary-sig-arg">parser</span>,
        <span class="summary-sig-arg">token</span>)</span><br />
      Retrieves the total scores for a list of objects and the number of
votes they have received and stores them in a context variable.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#do_scores_for_objects">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="digichef.voting.templatetags.voting_tags-module.html#do_vote_by_user" class="summary-sig-name">do_vote_by_user</a>(<span class="summary-sig-arg">parser</span>,
        <span class="summary-sig-arg">token</span>)</span><br />
      Retrieves the ``Vote`` cast by a user on a particular object and
stores it in a context variable.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#do_vote_by_user">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="digichef.voting.templatetags.voting_tags-module.html#do_votes_by_user" class="summary-sig-name">do_votes_by_user</a>(<span class="summary-sig-arg">parser</span>,
        <span class="summary-sig-arg">token</span>)</span><br />
      Retrieves the votes cast by a user on a list of objects as a
dictionary keyed with object ids and stores it in a context
variable.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#do_votes_by_user">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="digichef.voting.templatetags.voting_tags-module.html#do_dict_entry_for_item" class="summary-sig-name">do_dict_entry_for_item</a>(<span class="summary-sig-arg">parser</span>,
        <span class="summary-sig-arg">token</span>)</span><br />
      Given an object and a dictionary keyed with object ids - as
returned by the ``votes_by_user`` and ``scores_for_objects``
template tags - retrieves the value for the given object and
stores it in a context variable, storing ``None`` if no value
exists for the given object.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#do_dict_entry_for_item">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="digichef.voting.templatetags.voting_tags-module.html#confirm_vote_message" class="summary-sig-name">confirm_vote_message</a>(<span class="summary-sig-arg">object_description</span>,
        <span class="summary-sig-arg">vote_direction</span>)</span><br />
      Creates an appropriate message asking the user to confirm the given vote
for the given object description.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#confirm_vote_message">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="digichef.voting.templatetags.voting_tags-module.html#vote_display" class="summary-sig-name">vote_display</a>(<span class="summary-sig-arg">vote</span>,
        <span class="summary-sig-arg">arg</span>=<span class="summary-sig-default">None</span>)</span><br />
      Given a string mapping values for up and down votes, returns one
of the strings according to the given ``Vote``:</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#vote_display">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="register"></a><span class="summary-name">register</span> = <code title="template.Library()">template.Library()</code>
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="do_score_for_object"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">do_score_for_object</span>(<span class="sig-arg">parser</span>,
        <span class="sig-arg">token</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#do_score_for_object">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

Retrieves the total score for an object and the number of votes
it's received and stores them in a context variable which has
``score`` and ``num_votes`` properties.

Example usage::

    {% score_for_object widget as score %}

    {{ score.score }}point{{ score.score|pluralize }}
    after {{ score.num_votes }} vote{{ score.num_votes|pluralize }}

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="do_scores_for_objects"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">do_scores_for_objects</span>(<span class="sig-arg">parser</span>,
        <span class="sig-arg">token</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#do_scores_for_objects">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

Retrieves the total scores for a list of objects and the number of
votes they have received and stores them in a context variable.

Example usage::

    {% scores_for_objects widget_list as score_dict %}

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="do_vote_by_user"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">do_vote_by_user</span>(<span class="sig-arg">parser</span>,
        <span class="sig-arg">token</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#do_vote_by_user">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

Retrieves the ``Vote`` cast by a user on a particular object and
stores it in a context variable. If the user has not voted, the
context variable will be ``None``.

Example usage::

    {% vote_by_user user on widget as vote %}

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="do_votes_by_user"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">do_votes_by_user</span>(<span class="sig-arg">parser</span>,
        <span class="sig-arg">token</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#do_votes_by_user">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

Retrieves the votes cast by a user on a list of objects as a
dictionary keyed with object ids and stores it in a context
variable.

Example usage::

    {% votes_by_user user on widget_list as vote_dict %}

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="do_dict_entry_for_item"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">do_dict_entry_for_item</span>(<span class="sig-arg">parser</span>,
        <span class="sig-arg">token</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#do_dict_entry_for_item">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

Given an object and a dictionary keyed with object ids - as
returned by the ``votes_by_user`` and ``scores_for_objects``
template tags - retrieves the value for the given object and
stores it in a context variable, storing ``None`` if no value
exists for the given object.

Example usage::

    {% dict_entry_for_item widget from vote_dict as vote %}

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="confirm_vote_message"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">confirm_vote_message</span>(<span class="sig-arg">object_description</span>,
        <span class="sig-arg">vote_direction</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#confirm_vote_message">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

Creates an appropriate message asking the user to confirm the given vote
for the given object description.

Example usage::

    {% confirm_vote_message widget.title direction %}

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="vote_display"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">vote_display</span>(<span class="sig-arg">vote</span>,
        <span class="sig-arg">arg</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="digichef.voting.templatetags.voting_tags-pysrc.html#vote_display">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

Given a string mapping values for up and down votes, returns one
of the strings according to the given ``Vote``:

=========  =====================  =============
Vote type   Argument               Outputs
=========  =====================  =============
``+1``     ``&quot;Bodacious,Bogus&quot;``  ``Bodacious``
``-1``     ``&quot;Bodacious,Bogus&quot;``  ``Bogus``
=========  =====================  =============

If no string mapping is given, &quot;Up&quot; and &quot;Down&quot; will be used.

Example usage::

    {{ vote|vote_display:&quot;Bodacious,Bogus&quot; }}

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Apr  1 02:28:20 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
